package com.zmf.demo.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName student
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "学生表")
public class Student implements Serializable {
    /**
     * 
     */
    @ApiModelProperty(value ="学生编号")
    @TableId
    private Integer smpno;

    /**
     * 
     */
    @ApiModelProperty(value = "学生姓名")
    private String sname;

    /**
     * 
     */
    @ApiModelProperty(value = "入学时间")
    @DateTimeFormat(pattern = "yy-MM-dd")
    private Date sdate;

    /**
     * 
     */
    @ApiModelProperty(value = "班级编号")

    private Integer sno;



    @TableField(exist = false)
    private Class aClass;


    public Student(Integer smpno, String sname, Date sdate, Integer sno) {
        this.smpno = smpno;
        this.sname = sname;
        this.sdate = sdate;
        this.sno = sno;
    }

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Integer getSmpno() {
        return smpno;
    }

    /**
     * 
     */
    public void setSmpno(Integer smpno) {
        this.smpno = smpno;
    }

    /**
     * 
     */
    public String getSname() {
        return sname;
    }

    /**
     * 
     */
    public void setSname(String sname) {
        this.sname = sname;
    }

    /**
     * 
     */
    public Date getSdate() {
        return sdate;
    }

    /**
     * 
     */
    public void setSdate(Date sdate) {
        this.sdate = sdate;
    }

    /**
     * 
     */
    public Integer getSno() {
        return sno;
    }

    /**
     * 
     */
    public void setSno(Integer sno) {
        this.sno = sno;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Student other = (Student) that;
        return (this.getSmpno() == null ? other.getSmpno() == null : this.getSmpno().equals(other.getSmpno()))
            && (this.getSname() == null ? other.getSname() == null : this.getSname().equals(other.getSname()))
            && (this.getSdate() == null ? other.getSdate() == null : this.getSdate().equals(other.getSdate()))
            && (this.getSno() == null ? other.getSno() == null : this.getSno().equals(other.getSno()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSmpno() == null) ? 0 : getSmpno().hashCode());
        result = prime * result + ((getSname() == null) ? 0 : getSname().hashCode());
        result = prime * result + ((getSdate() == null) ? 0 : getSdate().hashCode());
        result = prime * result + ((getSno() == null) ? 0 : getSno().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", smpno=").append(smpno);
        sb.append(", sname=").append(sname);
        sb.append(", sdate=").append(sdate);
        sb.append(", sno=").append(sno);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}